package sqlanalysisgui.view.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class FileAnalysisInfo {
	private String tableName;
	private String totalFile;
	private String totalFileLine;
	private String useSqlFile;
	private String totalCount;
	private String cType;
	private String rType;
	private String uType;
	private String dType;
	private String cTypeRatio;
	private String rTypeRatio;
	private String uTypeRatio;
	private String dTypeRatio;
	private String tableRatio;
	/*
	 * JFace Data Binding 은 자바오브젝트의 속성이 변했을 때 이를 감지하고 반응할 수 있도록 자기 자신을 이 속성의
	 * listener로 등록할 수 있다. SWT와 JFace Widget은 이것을 지원한다.
	 */
	private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
			this);

	public FileAnalysisInfo() {
		// TODO Auto-generated constructor stub
	}

	public FileAnalysisInfo(String totalFile, String totalFileLine,
			String useSqlFile, String cType, String rType, String uType,
			String dType, String cTypeRatio, String rTypeRatio,
			String uTypeRatio, String dTypeRatio) {
		super();
		this.totalFile = totalFile;
		this.totalFileLine = totalFileLine;
		this.useSqlFile = useSqlFile;
		this.cType = cType;
		this.rType = rType;
		this.uType = uType;
		this.dType = dType;
		this.cTypeRatio = cTypeRatio;
		this.rTypeRatio = rTypeRatio;
		this.uTypeRatio = uTypeRatio;
		this.dTypeRatio = dTypeRatio;
	}

	public FileAnalysisInfo(String totalFile, String totalFileLine,
			String useSqlFile, String cType, String rType, String uType,
			String dType) {
		super();
		this.totalFile = totalFile;
		this.totalFileLine = totalFileLine;
		this.useSqlFile = useSqlFile;
		this.cType = cType;
		this.rType = rType;
		this.uType = uType;
		this.dType = dType;
	}

	public FileAnalysisInfo(String tableName, String totalCount, String cType,
			String rType, String uType, String dType, String tableRatio,
			String book) {
		super();
		this.totalCount = totalCount;
		this.tableName = tableName;
		this.cType = cType;
		this.rType = rType;
		this.uType = uType;
		this.dType = dType;
		this.tableRatio = tableRatio;
	}

	public FileAnalysisInfo(String tableName, String totalCount) {
		super();
		this.tableName = tableName;
		this.totalCount = totalCount;
	}

	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener) {
		propertyChangeSupport.removePropertyChangeListener(listener);
	}

	public String getTotalFile() {
		return totalFile;
	}

	public void setTotalFile(String totalFile) {
		propertyChangeSupport.firePropertyChange("totalFile", this.totalFile,
				this.totalFile = totalFile);
	}

	public String getTotalFileLine() {
		return totalFileLine;
	}

	public void setTotalFileLine(String totalFileLine) {
		propertyChangeSupport.firePropertyChange("totalFileLine",
				this.totalFileLine, this.totalFileLine = totalFileLine);
	}

	public String getUseSqlFile() {
		return useSqlFile;
	}

	public void setUseSqlFile(String useSqlFile) {
		propertyChangeSupport.firePropertyChange("useSqlFile", this.useSqlFile,
				this.useSqlFile = useSqlFile);
	}

	public String getcType() {
		return cType;
	}

	public void setcType(String cType) {
		propertyChangeSupport.firePropertyChange("cType", this.cType,
				this.cType = cType);
	}

	public String getrType() {
		return rType;
	}

	public void setrType(String rType) {
		propertyChangeSupport.firePropertyChange("rType", this.rType,
				this.rType = rType);
	}

	public String getuType() {
		return uType;
	}

	public void setuType(String uType) {
		propertyChangeSupport.firePropertyChange("uType", this.uType,
				this.uType = uType);
	}

	public String getdType() {
		return dType;
	}

	public void setdType(String dType) {
		propertyChangeSupport.firePropertyChange("dType", this.dType,
				this.dType = dType);
	}

	public PropertyChangeSupport getPropertyChangeSupport() {
		return propertyChangeSupport;
	}

	public void setPropertyChangeSupport(
			PropertyChangeSupport propertyChangeSupport) {
		this.propertyChangeSupport = propertyChangeSupport;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		propertyChangeSupport.firePropertyChange("tableName", this.tableName,
				this.tableName = tableName);
	}

	public String getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(String totalCount) {
		propertyChangeSupport.firePropertyChange("totalCount", this.totalCount,
				this.totalCount = totalCount);
	}

	public String getcTypeRatio() {
		return cTypeRatio;
	}

	public void setcTypeRatio(String cTypeRatio) {
		propertyChangeSupport.firePropertyChange("cTypeRatio", this.cTypeRatio,
				this.cTypeRatio = cTypeRatio);
	}

	public String getrTypeRatio() {
		return rTypeRatio;
	}

	public void setrTypeRatio(String rTypeRatio) {
		propertyChangeSupport.firePropertyChange("rTypeRatio", this.rTypeRatio,
				this.rTypeRatio = rTypeRatio);
	}

	public String getuTypeRatio() {
		return uTypeRatio;
	}

	public void setuTypeRatio(String uTypeRatio) {
		propertyChangeSupport.firePropertyChange("uTypeRatio", this.uTypeRatio,
				this.uTypeRatio = uTypeRatio);
	}

	public String getdTypeRatio() {
		return dTypeRatio;
	}

	public void setdTypeRatio(String dTypeRatio) {
		propertyChangeSupport.firePropertyChange("dTypeRatio", this.dTypeRatio,
				this.dTypeRatio = dTypeRatio);
	}

	public String getTableRatio() {
		return tableRatio;
	}

	public void setTableRatio(String tableRatio) {
		propertyChangeSupport.firePropertyChange("tableRatio", this.tableRatio,
				this.tableRatio = tableRatio);
	}

	@Override
	public String toString() {
		return "FileAnalysisInfo [tableName=" + tableName + ", totalFile="
				+ totalFile + ", totalFileLine=" + totalFileLine
				+ ", useSqlFile=" + useSqlFile + ", totalCount=" + totalCount
				+ ", cType=" + cType + ", rType=" + rType + ", uType=" + uType
				+ ", dType=" + dType + ", propertyChangeSupport="
				+ propertyChangeSupport + "]";
	}

}
